<?php
  require_once('inc_admin.php');
  //连接数据库 
  connect();
  //使用$_POST数组获取表单中输入的数据
  $id = $_POST['id'];


  if(!empty($_FILES["pic"]["name"])){
  	$pic = uploadfile('pic',UserPhotoPath,array('png','jpg','gif'));
  }
  else{
  	$pic=' ';
  }

  $data = array(
    'typename' => trim($_POST['typename']),  
		'tid' => $_POST['tid']);
		 $result = update('videotype',$data,'tid='.$id);
  if(!$result){
		echo "更新失败！<br/>";
		echo "<a href='videotypelist.php'>返回</a>";	  
  }else{		
		redirect('videotypelist.php', '更新成功！');
  }	   
 ?>